package io.lvdaxian.mybatis07.reflection.invoker;

import java.lang.reflect.Field;

/**
 * 获取属性的执行器
 *
 * @author lih
 */
public class GetFieldInvoker implements Invoker {
  
  private final Field field;
  
  public GetFieldInvoker(Field field) {
    this.field = field;
  }
  
  @Override
  public Object invoke(Object target, Object[] args) throws Exception {
    return field.get(target);
  }
  
  @Override
  public Class<?> getType() {
    return field.getType();
  }
}
